//Wed May 11 19:58:39 CDT 2011
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

class SlimeXSlimeRancher2 {
public:
	int train(vector<int> attributes) {
		sort(attributes.begin(), attributes.end());
		int sum = 0;
		for(int i=0; i<attributes.size(); i++)
			sum += attributes[attributes.size()-1] - attributes[i];
		return sum;
	}
};

